package com.smalls.newvideotwo.utils;

/**
 * Created by hs on 2018/4/25.
 */

public class StringUtils {
    public static String getChineseName(String name) {
        if(name!=null) {
            int start = name.indexOf("[");
            if(start>=0) {
                String subString = name.substring(0,start);
                return subString;
            }
        }
        return "";
    }

    public static String getEnglishName(String name) {
        if(name!=null) {
            int start = name.indexOf("[");
            int end = -1;
            if(start>=0) {
                end = name.indexOf("]",start);
                if(end<0) {
                    end = name.length();
                }
                String subString = name.substring(start+1,end);
                return subString;
            }
        }
        return "";
    }
}
